\(\int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 47 \[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=a^2 c^2 x-\frac {a^2 c^2 \tan (e+f x)}{f}+\frac {a^2 c^2 \tan ^3(e+f x)}{3 f} \]

[Out]

a^2*c^2*x-a^2*c^2*tan(f*x+e)/f+1/3*a^2*c^2*tan(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3989, 3554, 8} \[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=\frac {a^2 c^2 \tan ^3(e+f x)}{3 f}-\frac {a^2 c^2 \tan (e+f x)}{f}+a^2 c^2 x \]

[In]

Int[(a + a*Sec[e + f*x])^2*(c - c*Sec[e + f*x])^2,x]

[Out]

a^2*c^2*x - (a^2*c^2*Tan[e + f*x])/f + (a^2*c^2*Tan[e + f*x]^3)/(3*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3989

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[((-a)*c)^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rubi steps \begin{align*} \text {integral}& = \left (a^2 c^2\right ) \int \tan ^4(e+f x) \, dx \\ & = \frac {a^2 c^2 \tan ^3(e+f x)}{3 f}-\left (a^2 c^2\right ) \int \tan ^2(e+f x) \, dx \\ & = -\frac {a^2 c^2 \tan (e+f x)}{f}+\frac {a^2 c^2 \tan ^3(e+f x)}{3 f}+\left (a^2 c^2\right ) \int 1 \, dx \\ & = a^2 c^2 x-\frac {a^2 c^2 \tan (e+f x)}{f}+\frac {a^2 c^2 \tan ^3(e+f x)}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.96 \[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=a^2 c^2 \left (\frac {\arctan (\tan (e+f x))}{f}-\frac {\tan (e+f x)}{f}+\frac {\tan ^3(e+f x)}{3 f}\right ) \]

[In]

Integrate[(a + a*Sec[e + f*x])^2*(c - c*Sec[e + f*x])^2,x]

[Out]

a^2*c^2*(ArcTan[Tan[e + f*x]]/f - Tan[e + f*x]/f + Tan[e + f*x]^3/(3*f))

Maple [A] (verified)

Time = 1.70 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.19

method result size
parts \(a^{2} c^{2} x -\frac {a^{2} c^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}-\frac {2 a^{2} c^{2} \tan \left (f x +e \right )}{f}\) \(56\)
derivativedivides \(\frac {-a^{2} c^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-2 a^{2} c^{2} \tan \left (f x +e \right )+a^{2} c^{2} \left (f x +e \right )}{f}\) \(58\)
default \(\frac {-a^{2} c^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-2 a^{2} c^{2} \tan \left (f x +e \right )+a^{2} c^{2} \left (f x +e \right )}{f}\) \(58\)
risch \(a^{2} c^{2} x -\frac {4 i a^{2} c^{2} \left (3 \,{\mathrm e}^{4 i \left (f x +e \right )}+3 \,{\mathrm e}^{2 i \left (f x +e \right )}+2\right )}{3 f \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )^{3}}\) \(59\)
parallelrisch \(\frac {\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6} x f -3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} x f +2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}+3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} x f -\frac {20 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3}-f x +2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a^{2} c^{2}}{f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}\) \(123\)
norman \(\frac {a^{2} c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}-a^{2} c^{2} x +\frac {2 a^{2} c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {20 a^{2} c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f}+\frac {2 a^{2} c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{f}+3 a^{2} c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-3 a^{2} c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3}}\) \(150\)

[In]

int((a+a*sec(f*x+e))^2*(c-c*sec(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

a^2*c^2*x-a^2*c^2/f*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)-2*a^2*c^2*tan(f*x+e)/f

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.38 \[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=\frac {3 \, a^{2} c^{2} f x \cos \left (f x + e\right )^{3} - {\left (4 \, a^{2} c^{2} \cos \left (f x + e\right )^{2} - a^{2} c^{2}\right )} \sin \left (f x + e\right )}{3 \, f \cos \left (f x + e\right )^{3}} \]

[In]

integrate((a+a*sec(f*x+e))^2*(c-c*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

1/3*(3*a^2*c^2*f*x*cos(f*x + e)^3 - (4*a^2*c^2*cos(f*x + e)^2 - a^2*c^2)*sin(f*x + e))/(f*cos(f*x + e)^3)

Sympy [F]

\[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=a^{2} c^{2} \left (\int 1\, dx + \int \left (- 2 \sec ^{2}{\left (e + f x \right )}\right )\, dx + \int \sec ^{4}{\left (e + f x \right )}\, dx\right ) \]

[In]

integrate((a+a*sec(f*x+e))**2*(c-c*sec(f*x+e))**2,x)

[Out]

a**2*c**2*(Integral(1, x) + Integral(-2*sec(e + f*x)**2, x) + Integral(sec(e + f*x)**4, x))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.21 \[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=\frac {{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{2} c^{2} + 3 \, {\left (f x + e\right )} a^{2} c^{2} - 6 \, a^{2} c^{2} \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate((a+a*sec(f*x+e))^2*(c-c*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

1/3*((tan(f*x + e)^3 + 3*tan(f*x + e))*a^2*c^2 + 3*(f*x + e)*a^2*c^2 - 6*a^2*c^2*tan(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.02 \[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=\frac {a^{2} c^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (f x + e\right )} a^{2} c^{2} - 3 \, a^{2} c^{2} \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate((a+a*sec(f*x+e))^2*(c-c*sec(f*x+e))^2,x, algorithm="giac")

[Out]

1/3*(a^2*c^2*tan(f*x + e)^3 + 3*(f*x + e)*a^2*c^2 - 3*a^2*c^2*tan(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 16.62 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.79 \[ \int (a+a \sec (e+f x))^2 (c-c \sec (e+f x))^2 \, dx=a^2\,c^2\,x+\frac {2\,a^2\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5-\frac {20\,a^2\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{3}+2\,a^2\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}^3} \]

[In]

int((a + a/cos(e + f*x))^2*(c - c/cos(e + f*x))^2,x)

[Out]

a^2*c^2*x + (2*a^2*c^2*tan(e/2 + (f*x)/2)^5 - (20*a^2*c^2*tan(e/2 + (f*x)/2)^3)/3 + 2*a^2*c^2*tan(e/2 + (f*x)/
2))/(f*(tan(e/2 + (f*x)/2)^2 - 1)^3)